<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>05_json</title>
</head>
<body>
<script type="text/javascript">
  /*
    json的数据嵌套，你中有我，我中有你
    json的数据本质上是对象
    对象的键是字符串，对象的值是数组
    数组的元素是对象
  */
  let json = {
    "k1": [
      {"name":"张三", "age": 20},
      {"name": "李四", "age": 18}
    ],
    "k2": [
      {"name":"王五", "age": 20},
      {"name": "赵六", "age": 18}
    ]
  }

  for (const o in json) {
    for (let i = 0; i < json[o].length; i++) {
      console.log(json[o][i].name, json[o][i].age)
    }
  }
</script>
</body>
</html>